import subprocess
import os
import sys

proc = subprocess.Popen('./_exception.so', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

out, err = proc.communicate()

print out, err, proc.returncode